var local="http://47.104.10.151";
var keyId=getCookie('userId');
function getCookie(c_name)
{
    if (document.cookie.length>0)
    {
        c_start=document.cookie.indexOf(c_name + "=")
        if (c_start!=-1)
        {
            c_start=c_start + c_name.length+1
            c_end=document.cookie.indexOf(";",c_start)
            if (c_end==-1) c_end=document.cookie.length
            return unescape(document.cookie.substring(c_start,c_end))
        }
    }
    return ""
}
function buyStork1() {
    var url=local+":8080/stockorder/buyStock";
    xmlHttp=creatxmlHTTP();
    var txt="";//用于存储拼接字符串；
    //获取数据
    var stock_num=document.getElementById("Bid1").value;
    //拼接字符
    txt="user_id="+keyId+"&stock_num="+stock_num+"&stock_id="+stock_id1;
    alert("请注意是否设置默认收货地址");
    xmlHttp.open("POST",url,true);
    xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
    xmlHttp.send(txt);
    xmlHttp.onreadystatechange=function()
    {
        if (xmlHttp.readyState==4 && xmlHttp.status==200)
        {
            var result=xmlHttp.responseText;
            var json=eval("("+result+")");
            var msg=json.msg;
            alert("购买一："+msg);
        }
    }
}
function buyStork2() {
    var url=local+":8080/stockorder/buyStock";
    xmlHttp=creatxmlHTTP();
    var txt="";//用于存储拼接字符串；
    //获取数据
    var stock_num=document.getElementById("Bid2").value;
    //拼接字符
    txt="user_id="+keyId+"&stock_num="+stock_num+"&stock_id="+stock_id2;
    alert("请注意是否设置默认收货地址");
    xmlHttp.open("POST",url,true);
    xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
    xmlHttp.send(txt);
    xmlHttp.onreadystatechange=function()
    {
        if (xmlHttp.readyState==4 && xmlHttp.status==200)
        {
            var result=xmlHttp.responseText;
            var json=eval("("+result+")");
            var msg=json.msg;
            alert("购买2："+msg);
        }
    }

}
function buyStork3() {
    var url=local+":8080/stockorder/buyStock";
    xmlHttp=creatxmlHTTP();
    var txt="";//用于存储拼接字符串；
    //获取数据
    var stock_num=document.getElementById("Bid3").value;
    //拼接字符
    txt="user_id="+keyId+"&stock_num="+stock_num+"&stock_id="+stock_id3;
    alert("请注意是否设置默认收货地址");
    xmlHttp.open("POST",url,true);
    xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
    xmlHttp.send(txt);
    xmlHttp.onreadystatechange=function()
    {
        if (xmlHttp.readyState==4 && xmlHttp.status==200)
        {
            var result=xmlHttp.responseText;
            var json=eval("("+result+")");
            var msg=json.msg;
            alert("购买3："+msg);
        }
    }

}
function buyStork4() {
    var url=local+":8080/stockorder/buyStock";
    xmlHttp=creatxmlHTTP();
    var txt="";//用于存储拼接字符串；
    //获取数据
    var stock_num=document.getElementById("Bid4").value;
    //拼接字符
    txt="user_id="+keyId+"&stock_num="+stock_num+"&stock_id="+stock_id4;
    alert("请注意是否设置默认收货地址");
    xmlHttp.open("POST",url,true);
    xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
    xmlHttp.send(txt);
    xmlHttp.onreadystatechange=function()
    {
        if (xmlHttp.readyState==4 && xmlHttp.status==200)
        {
            var result=xmlHttp.responseText;
            var json=eval("("+result+")");
            var msg=json.msg;
            alert("购买4："+msg);
        }
    }

}
function buyStork5() {
    var url=local+":8080/stockorder/buyStock";
    xmlHttp=creatxmlHTTP();
    var txt="";//用于存储拼接字符串；
    //获取数据
    var stock_num=document.getElementById("Bid5").value;
    //拼接字符
    txt="user_id="+keyId+"&stock_num="+stock_num+"&stock_id="+stock_id5;
    alert("请注意是否设置默认收货地址");
    xmlHttp.open("POST",url,true);
    xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
    xmlHttp.send(txt);
    xmlHttp.onreadystatechange=function()
    {
        if (xmlHttp.readyState==4 && xmlHttp.status==200)
        {
            var result=xmlHttp.responseText;
            var json=eval("("+result+")");
            var msg=json.msg;
            alert("购买5："+msg);
        }
    }

}
function buyStork6() {
    var url=local+":8080/stockorder/buyStock";
    xmlHttp=creatxmlHTTP();
    var txt="";//用于存储拼接字符串；
    //获取数据
    var stock_num=document.getElementById("Bid6").value;
    //拼接字符
    txt="user_id="+keyId+"&stock_num="+stock_num+"&stock_id="+stock_id6;
    alert("请注意是否设置默认收货地址");
    xmlHttp.open("POST",url,true);
    xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
    xmlHttp.send(txt);
    xmlHttp.onreadystatechange=function()
    {
        if (xmlHttp.readyState==4 && xmlHttp.status==200)
        {
            var result=xmlHttp.responseText;
            var json=eval("("+result+")");
            var msg=json.msg;
            alert("购买6："+msg);
        }
    }

}
function buyStork7() {
    var url=local+":8080/stockorder/buyStock";
    xmlHttp=creatxmlHTTP();
    var txt="";//用于存储拼接字符串；
    //获取数据
    var stock_num=document.getElementById("Bid7").value;
    //拼接字符
    txt="user_id="+keyId+"&stock_num="+stock_num+"&stock_id="+stock_id7;
    alert("请注意是否设置默认收货地址");
    xmlHttp.open("POST",url,true);
    xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
    xmlHttp.send(txt);
    xmlHttp.onreadystatechange=function()
    {
        if (xmlHttp.readyState==4 && xmlHttp.status==200)
        {
            var result=xmlHttp.responseText;
            var json=eval("("+result+")");
            var msg=json.msg;
            alert("购买7："+msg);
        }
    }

}
function buyStork8() {
    var url=local+":8080/stockorder/buyStock";
    xmlHttp=creatxmlHTTP();
    var txt="";//用于存储拼接字符串；
    //获取数据
    var stock_num=document.getElementById("Bid8").value;
    //拼接字符
    txt="user_id="+keyId+"&stock_num="+stock_num+"&stock_id="+stock_id8;
    alert("请注意是否设置默认收货地址");
    xmlHttp.open("POST",url,true);
    xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
    xmlHttp.send(txt);
    xmlHttp.onreadystatechange=function()
    {
        if (xmlHttp.readyState==4 && xmlHttp.status==200)
        {
            var result=xmlHttp.responseText;
            var json=eval("("+result+")");
            var msg=json.msg;
            alert("购买8："+msg);
        }
    }

}
function buyStork9() {
    var url=local+":8080/stockorder/buyStock";
    xmlHttp=creatxmlHTTP();
    var txt="";//用于存储拼接字符串；
    //获取数据
    var stock_num=document.getElementById("Bid9").value;
    //拼接字符
    txt="user_id="+keyId+"&stock_num="+stock_num+"&stock_id="+stock_id9;
    alert("请注意是否设置默认收货地址");
    xmlHttp.open("POST",url,true);
    xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
    xmlHttp.send(txt);
    xmlHttp.onreadystatechange=function()
    {
        if (xmlHttp.readyState==4 && xmlHttp.status==200)
        {
            var result=xmlHttp.responseText;
            var json=eval("("+result+")");
            var msg=json.msg;
            alert("购买9："+msg);
        }
    }

}
function buyStork10() {
    var url=local+":8080/stockorder/buyStock";
    xmlHttp=creatxmlHTTP();
    var txt="";//用于存储拼接字符串；
    //获取数据
    var stock_num=document.getElementById("Bid10").value;
    //拼接字符
    txt="user_id="+keyId+"&stock_num="+stock_num+"&stock_id="+stock_id10;
    alert("请注意是否设置默认收货地址");
    xmlHttp.open("POST",url,true);
    xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
    xmlHttp.send(txt);
    xmlHttp.onreadystatechange=function()
    {
        if (xmlHttp.readyState==4 && xmlHttp.status==200)
        {
            var result=xmlHttp.responseText;
            var json=eval("("+result+")");
            var msg=json.msg;
            alert("购买10："+msg);
        }
    }

}
function buyStork11() {
    var url=local+":8080/stockorder/buyStock";
    xmlHttp=creatxmlHTTP();
    var txt="";//用于存储拼接字符串；
    //获取数据
    var stock_num=document.getElementById("Bid11").value;
    //拼接字符
    txt="user_id="+keyId+"&stock_num="+stock_num+"&stock_id="+stock_id11;
    alert("请注意是否设置默认收货地址");
    xmlHttp.open("POST",url,true);
    xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
    xmlHttp.send(txt);
    xmlHttp.onreadystatechange=function()
    {
        if (xmlHttp.readyState==4 && xmlHttp.status==200)
        {
            var result=xmlHttp.responseText;
            var json=eval("("+result+")");
            var msg=json.msg;
            alert("购买11："+msg);
        }
    }

}
function buyStork12() {
    var url=local+":8080/stockorder/buyStock";
    xmlHttp=creatxmlHTTP();
    var txt="";//用于存储拼接字符串；
    //获取数据
    var stock_num=document.getElementById("Bid12").value;
    //拼接字符
    txt="user_id="+keyId+"&stock_num="+stock_num+"&stock_id="+stock_id12;
    alert("请注意是否设置默认收货地址");
    xmlHttp.open("POST",url,true);
    xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
    xmlHttp.send(txt);
    xmlHttp.onreadystatechange=function()
    {
        if (xmlHttp.readyState==4 && xmlHttp.status==200)
        {
            var result=xmlHttp.responseText;
            var json=eval("("+result+")");
            var msg=json.msg;
            alert("购买12："+msg);
        }
    }

}
